

import myArray from './functions'


Page({

  /**
   * 页面的初始数据
   */
  data: {

  },

  /**
   * 生命周期函数--监听页面加载
   */
  async onLoad(options) {
    const a=myArray(11,3,13,131,411,12)
    console.log(a);
    this.setData({
      a:Object.keys(a)
    })
    const aFilter=a.filter((x,i)=>{
      return i>2
    })
    console.log('filter',aFilter);

    const aMap=a.map((x,i)=>{
      return x*2
    })
    console.log('map',aMap);

    const aReduce=a.reduce((prev,x,i)=>{
      return prev+x
    },0)
    console.log('reduce',aReduce);

    const aEvery=a.every((x,i)=>{
      return x>3
    })
    console.log('every',aEvery);

    const aSome=a.some((x,i)=>{
      return x>3000
    })
    console.log('some',aSome);

    const aForEachEnd=a.forEachEnd((x,i)=>{
      console.log('forEach 内部执行',i);
      if(i>2) return true
    })
    console.log('forEachEnd',aForEachEnd);


   



  },

})


















